﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<MensUnoShop.Models.ViewModels.RegionViewModel>" %>
<%@ Import Namespace="MensUnoShop.Helpers" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	men'suno SHOP
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<div class="CONTENT2">
<div class="CONTENT_LEFT">
<ul>
            <%Html.RenderPartial("/Views/Shared/SearchBox.ascx"); %>
            <%Html.RenderPartial("/Views/Shared/ProductTitle.ascx",Model.LEFTTAG); %>
            <%Html.RenderPartial("/Views/Shared/HotSearch.ascx"); %>
            <%Html.RenderPartial("/Views/Shared/News.ascx"); %>
        </ul></div>
<div class="CONTENT_RIGHT">
<p class="FAST_LINK"><%=Html.GetNavLinkString(Model.NAVLIST)%></p>
<ul>
  <img src="/Content/page_img/pic_product_magazine.jpg" class="PRODUCT3_IMG" />
  <ul class="PRODUCT3_CONTENT">
  <li>
<li class="PRODUCT3_STYLE">【父親節好禮訂閱專案】</li>
<li class="PRODUCT3_STYLE">訂閱men’s uno男人誌半年6期＋Andy Warhol Nothing Special系列腕錶</li>
<li></li>
<li class="PRODUCT_COMES_BT">數量：<input type="text" id="specamt" class="MEMBER_BOX" value="1" size="5" />
<li>
  <input type="radio" name="radio" id="radio" value="radio" checked="checked" />
  新訂戶：<span class="PRODUCT3_PRICE">NTD 2000</span></li>
<li>
  <input type="radio" name="radio2" id="radio2" value="radio2" />
  舊訂戶：<span class="PRODUCT3_PRICE">NTD 1800</span></li>
<li>
<div class="PUTIN_SHOPPING_CART">
<ul class="PRODUCT3_SHARE">
<li class="PRODUCT3_SHARE_FACEBOOK"><a href="#">facebook</a></li>
<li class="PRODUCT3_SHARE_TWITTER"><a href="#">twitter</a></li>
<li class="PRODUCT3_SHARE_PLURK"><a href="#">plurk</a></li>
<li class="PRODUCT3_SHARE_SINA"><a href="#">sina</a></li>
</ul>
</div>
<br class="CLEAR" />
</li>
<li><a href="#" class="intoCart"><img src="/Content/page_img/cart_bt_magazine.gif" /></a></li>
</ul>
</li>
<br class="CLEAR" />
<li class="PRODUCT3_CONTENT_WORD">
  <p>訂閱men’s uno男人誌半年6期＋Andy Warhol Nothing Special系列腕錶， <br />
只要NT$1,000元 (原價NT＄2,460，現省NT＄1,460)</p>
</li>
<li class="PRODUCT3_CONTENT_WORD">
  <p> 極簡、低調、中性的設計，讓這款腕表不論男女都能配戴。取材自普普藝術大師安迪·沃荷(Andy Warhol)的經典作品，以塑料的材質，於錶面上展現大師風範，可突顯配戴者獨特的個性、氣質與風格。</p>
</li>
<li class="PRODUCT3_CONTENT_IMGAE">
  <p>▼兩色隨機出貨</p><div><img src="/Content/page_img/pic_product_magazine2.jpg" /></div></li>
</li>
</ul>
<img src="/Content/page_img/content2_bottom.gif" /></div>
<br class="CLEAR" />
</div>
<script type="text/javascript">
$(document).ready(function () { $('.intoCart').click(goShopping); shareArticle();});
function goShopping() {
    <%if(Model.MEMBER==null){ %>
        alert('請先登入會員!!');
    <%//}else if(Model.PRODUCT.SPEC.Sum(s=>s.STOCK)==0){ %>
    //        alert('賣場暫無庫存!!');
    <%}else{ %>
       if($("#specamt").val() > "0"){
           var jsonstring = {  "Mid": '647BC599-3A38-4949-9DAC-720736CD66DE',
                               "ProductId": 'b9a3b292-432a-471b-98ea-caf1401db77d',
                               "SpecId": '20d4767a-d755-4c10-a380-09e6b877d722',
                               "AmountId": $("#specamt").val()
                             };
            $.ajax({
                type: "POST",
                traditional: true,
                url: "/api/stc",
                data: jsonstring,
                dataType: "json",
                success: function (data) {
                    if(data.code=="200"){
                        location.href='/order/fs';
                    }
                    else
                        alert(data.response);
                } 
            });
        }
        else
            alert('請選擇數量');
        <%} %>
    }

    $(window).load(function(){
	    $('#pdintro img').each(function(i){
			$(this).removeAttr('width');
			$(this).removeAttr('height');
 
			//取得影像實際的長寬
			var imgW = $(this).width();
			var imgH = $(this).height();
 
			//計算縮放比例
			var w=500/imgW;
			var pre=1;
			if(w<1){
				pre=w;
			}else{
				pre=1;
			}
 
			if(pre!=1){
			    $(this).width(500);
			    $(this).height(imgH*pre);
                }
		});
    });
</script>

</asp:Content>
